|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectvectorimage.VectorImage
raar.world.RAWorld
public class RAWorld
The world contains objects to simulate with.
| Field Summary | |
|---|---|
static int |
AGENT_CROSSING_EDGE
Setting what should happen if the agent crosses the edge of the map. |
static boolean |
SHOW_SENSOR_SHAPES
Whether or not to show sensor shapes in the world visual representation. |
static int |
SPEED_SCALAR
Number of pixels to advance agents if their speed is 1. |
static int |
STOP_LOOP
Setting: if agent crosses the edge of the map, appear at opposite end. |
static int |
STOP_REMAIN
Setting: if agent crosses the edge of the map, remain there. |
static int |
STOP_STOP
Setting: if agent crosses the edge of the map, stop simulation. |
| Constructor Summary | |
|---|---|
RAWorld(java.lang.String sourceCode,
java.awt.Dimension size,
java.awt.Color bgColor,
java.util.Vector classes,
java.util.Vector objects)
Construct a world with source code, size, colour, classes and objects as specified. |
|
| Method Summary | |
|---|---|
void |
addAgent(RAAgent agent)
Add an agent to the world. |
boolean |
containsAgent(RAAgent agent)
See whether the world contains this agent. |
boolean |
containsObject(RAWorldObject object)
Return whether the world contains the object given. |
RAWorldObject[] |
createExampleInstance(java.lang.String className)
Create an example instance of a class. |
double |
distance(java.awt.geom.Point2D.Double point,
RAWorldObject object,
java.awt.Shape inRegion)
Return the distance between point and object, provided that we only look inside inRegion. |
java.util.Vector |
getAgents()
Return the agents in this world. |
java.awt.Color |
getClassColor(java.lang.String className)
Return the colour of objects of this class. |
java.util.Vector |
getClassNames()
Return the names of the object classes present in this world. |
java.util.Vector |
getFactoryObjectNames()
Return the objects that can be constructed with factories. |
GVectorObject[] |
getGVectorObjects(VectorObject vo)
Return graphical representation(s) for the object given. |
java.awt.Color |
getObjectColor(java.lang.String objectName)
Return the colour of object given. |
java.util.Vector |
getObjects()
Return the RAWorldObjects present, including agents -- overridden. |
java.lang.String |
getSourceCode()
Return the source code. |
boolean |
isAgentGrippingSomething(RAAgent a)
Return whether the agent's gripper is currently gripping something. |
void |
processAgent(RAAgent agent)
Process the agent, ie. make sure that it moves and acts according to its actors. |
void |
removeAgent(RAAgent agent)
Remove an agent from the world. |
void |
reset()
Reset the entire world. |
void |
tryAddObject(java.lang.String className,
java.lang.String name,
RAAgent agent)
Let agent try to add an object with name given, of class name given. |
void |
tryRemoveObject(java.lang.String className,
RAAgent agent)
Let agent try to remove an object with name given, of class name given. |
| Methods inherited from class vectorimage.VectorImage |
|---|
addObject, findObjectAt, getBackground, getSize, getUsedColors, removeObject, setBackground, setSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean SHOW_SENSOR_SHAPES
public static final int STOP_LOOP
public static final int STOP_REMAIN
public static final int STOP_STOP
public static int AGENT_CROSSING_EDGE
public static int SPEED_SCALAR
| Constructor Detail |
|---|
public RAWorld(java.lang.String sourceCode,
java.awt.Dimension size,
java.awt.Color bgColor,
java.util.Vector classes,
java.util.Vector objects)
| Method Detail |
|---|
public java.lang.String getSourceCode()
public java.util.Vector getObjects()
getObjects in class VectorImagepublic java.util.Vector getFactoryObjectNames()
public java.util.Vector getClassNames()
public java.awt.Color getClassColor(java.lang.String className)
throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundExceptionpublic java.awt.Color getObjectColor(java.lang.String objectName)
public boolean containsObject(RAWorldObject object)
public double distance(java.awt.geom.Point2D.Double point,
RAWorldObject object,
java.awt.Shape inRegion)
public void addAgent(RAAgent agent)
public boolean containsAgent(RAAgent agent)
public void removeAgent(RAAgent agent)
public void processAgent(RAAgent agent)
throws RAException
RAExceptionpublic boolean isAgentGrippingSomething(RAAgent a)
public java.util.Vector getAgents()
public RAWorldObject[] createExampleInstance(java.lang.String className)
public void tryAddObject(java.lang.String className,
java.lang.String name,
RAAgent agent)
public void tryRemoveObject(java.lang.String className,
RAAgent agent)
public void reset()
throws RAException
RAExceptionpublic GVectorObject[] getGVectorObjects(VectorObject vo)
getGVectorObjects in class VectorImage
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||